package com.androidsocketd.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;

import com.androidsocketd.bean.Classes;
import com.androidsocketd.bean.MachineNumber;
import com.androidsocketd.bean.Post;

import java.util.List;

import static com.androidsocketd.R.id.delete;

/**
 * Created by yao on 2021/3/23.
 * Describe
 */
@Dao
public interface MachineNumDao {

    @Query("SELECT * FROM MachineNumber")
    List<MachineNumber> getAllMachine();

    @Query("SELECT * FROM MachineNumber WHERE machineName=:machineName")
    MachineNumber getMachineOne(String machineName);

    @Insert
    void insert(MachineNumber machineNumber);

    @Query("DELETE FROM MachineNumber WHERE MachineNumber.machineName=:machineName")
    void deleteOne(String  machineName);

    @Delete
    void deleteAll(List<MachineNumber> machineNumber);


//    @Delete
//    void delete(MachineNumber... machineNumber);
}
